#ifndef TEXTPLAYER_H
#define TEXTPLAYER_H

#include "player.h"

#include <QString>
#include <QLabel>
#include <QTimer>
#include <QFont>

class TextPlayer : public QLabel, public Player
{
	Q_OBJECT
public:
	static const QString TextFilePathName;
	static const QString TextName;
	TextPlayer(QWidget* parent = NULL);
	~TextPlayer();

	bool playOn(const ValuePacket &values, QWidget *target = NULL, QString* errorStr = NULL);
	PlayerType type() const;
	void dispose();
	void hideMe();
	void showMe();
signals:
	void deleteMe();
protected:
	void resizeEvent(QResizeEvent *);
private slots:
	void updateText();
private:
	QTimer m_UpdateTimer;
	int m_CurrentTextPtr;
	int m_UpdateInterval;
	QString m_Text;
	QFont m_TextFont;
};

#endif // TEXTPLAYER_H
